You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds update notifications and in-place updates, using GH releases as the source of truth.
This PR:
Checks GitHub Releases once a day and caches the result in ~/.codiff/update-state.json, shared by the app and the CLI
Shows a small pill at the bottom of the sidebar when an update is available. One click applies it: macOS and Squirrel Windows download the update and restart into the new version, Linux and non-Squirrel Windows download the matching release asset and open it, then the pill asks you to quit to finish
The pill tracks progress (updating, quit to finish, failed with one-click retry), and its tooltip says what clicking will do for the platform's update strategy
Adds codiff update to the CLI, which upgrades through Homebrew when the cask owns the install, opens the app to update itself otherwise, and points at the release page for source checkouts
Prints a one-line notice after codiff --version when a newer version is cached, implemented in the Node CLI and mirrored in the POSIX sh wrapper with the same version comparison and state validation so a broken or stale state file stays silent
ScreenshotsPrevious iterations
This iteration was a two-click update, which after some thought it felt like it can be simplified to match modern tools like VSCode and Codex, an update is just a single-click and self-explanatory. So I decided to match it.
Used Fable 5 xhigh with 20 iterations of review with Sol 5.6 xhigh.
Windows now has its own manual strategy: since the releases deliberately ship only a ZIP, the update button opens the release page instead of downloading an archive that can't install itself. The status stays available because nothing was installed.
codiff update no longer special-cases brew, it hands every packaged install to the app's self-updater. On the tap side I'd add auto_updates true together with the first release that ships this updater, not before: brew upgrade skips auto_updates casks unless --greedy, so flipping it while 1.9.2 is current would leave existing brew installs with no update path at all.
Downloads now stream to disk through a SHA-256 hash and are verified against the digest GitHub publishes for the asset before anything is opened. A missing or mismatched digest deletes the file and surfaces an error. This also removes the full in-memory buffering and sync write.
Linux assets are matched against process.arch (amd64/arm64 for deb, x86_64/aarch64 for rpm), with a fallback to an unmarked asset. An installer marked for another architecture is refused rather than opened.
All the update pill CSS (and its variables) moved to Desktop.css.
The pill itself now renders through the shared <Button> component and only layers an accent fill on top, so it picks up the squircle corners and sizing from the shared styles.
Awesome! I think we are getting close with this PR. I have a bit more feedback from my agent's review here:
Blocking: installer downloads can destroy an existing file
The updater downloads directly to the final filename in Downloads using createWriteStream(path). That truncates any existing same-named installer. If downloading or verification fails, the catch handler then deletes that path.
I reproduced this: an existing codiff_1.9.3_amd64.deb containing unrelated data was overwritten, failed verification, and disappeared entirely.
It should download to a uniquely created temporary path and only expose/open that file after verification. It must never truncate or remove a pre-existing user file.
Smaller bug: disabling update checks can leave the notification visible
checkForUpdates: false prevents future scheduled checks, but the updater initializes its status from the cached state before considering that setting. Someone who disables updates after an update was cached will continue seeing the pill indefinitely.
This is less severe, but it contradicts the setting’s description and centrally managed installations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds update notifications and in-place updates, using GH releases as the source of truth.
This PR:
~/.codiff/update-state.json, shared by the app and the CLIcodiff updateto the CLI, which upgrades through Homebrew when the cask owns the install, opens the app to update itself otherwise, and points at the release page for source checkoutscodiff --versionwhen a newer version is cached, implemented in the Node CLI and mirrored in the POSIX sh wrapper with the same version comparison and state validation so a broken or stale state file stays silentScreenshots
Previous iterations
This iteration was a two-click update, which after some thought it felt like it can be simplified to match modern tools like VSCode and Codex, an update is just a single-click and self-explanatory. So I decided to match it.Used Fable 5 xhigh with 20 iterations of review with Sol 5.6 xhigh.